var Cookie = {
    get: function (key) {
        var v = document.cookie.match('(?:^|;)\\s*' + key + '=([^;]*)');
		return (v) ? decodeURIComponent(v[1]) : null;
    },
    set: function (key, value) {
        var date = new Date();
        date.setTime(date.getTime() + 24 * 60 * 60 * 1000);
        value = encodeURIComponent(value) + '; expires=' + date.toGMTString();
		document.cookie = key + '=' + value;
    }
};
$(function(){
    if (Cookie.get('flash') != 1) {
        $('#swf').show().flash({
            src: 'dmg.swf',
            width: '100%',
            height: '100%'
        });
        Cookie.set('flash', 1);
    }
  var overlayFadeIn = function(slider) {
    $("#slider-top li.activePage .caption-right").fadeIn();
  };
  var overlayFadeOut = function() {
    $("#slider-top li .caption-right").hide();
  }
  $('#slider-top').anythingSlider(
    {
      delay: 5000,
      resumeDelay: 5000,
      buildStartStop: false,
      autoPlay: true,
      autoPlayLocked: true,
      hashTags: false,
      buildArrows: false,
      onSlideComplete: overlayFadeIn,
      onSlideBegin: overlayFadeOut
    }
  );
  $("#slider .slider-r").click(function() {
    $('#slider-top').data('AnythingSlider').goForward();
  });
  $("#slider .slider-l").click(function() {
    $('#slider-top').data('AnythingSlider').goBack();
  });
  $("#slider .anythingControls li").mouseover(function() {
    $('#slider-top').stop().anythingSlider($("span", this).text());
  });
  $("#slider .anythingControls li").mouseout(function() {
  });
  
  $('#slider-posters').anythingSlider({
			expand       : true,
			showMultiple : 5,
			changeBy     : 2,
			delay: 5000,
      resumeDelay: 5000,
      buildStartStop: false,
      autoPlay: true
  });
  
  $(".news-top ul.news-list li").mouseover(function() {
    $(".news-top .news-big .news-content").removeClass("current");
    $("#"+$(this).attr("rel")).addClass("current");
  });

  $(".trailer-top ul.trailer-list li").mouseover(function() {
    $(".trailer-top .trailer-big .trailer-content").removeClass("current");
    $("#"+$(this).attr("rel")).addClass("current");
  });
  
  $(".star-top ul.star-list li").mouseover(function() {
    $(".star-top .star-big .star-content").removeClass("current");
    $("#"+$(this).attr("rel")).addClass("current");
  });
  
  
});

  



